<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .nav {
            width: 666px;
            height: 46px;
            background: url(./img/index_top.gif) no-repeat;
            border: 1px solid red;
            margin: 100px auto;
            display: flex;
            justify-content: space-around;
            padding-top: 35px;
        }
    </style>
</head>

<body>
    <div class="nav">
        <div>
            <img src="./img/index_00.gif" />
        </div>
        <div>
            <img src="./img/index_01.gif" />
        </div>
        <div>
            <img src="./img/index_02.gif" />
        </div>
        <div>
            <img src="./img/index_03.gif" />
        </div>
        <div>
            <img src="./img/index_04.gif" />
        </div>
        <div>
            <img src="./img/index_05.gif" />
        </div>
        <div>
            <img src="./img/index_06.gif" />
        </div>
        <div>
            <img src="./img/index_07.gif" />
        </div>
    </div>
    <script>
        var oBox = document.getElementsByTagName('img');
        for (var i = 0; i < oBox.length; i++) {
            oBox[i].index = i;
            oBox[i].onmouseover = function () {
                this.src = "./img/index_0" + this.index + "_f2.gif";
            }
            oBox[i].onmouseout = function () {
                this.src = "./img/index_0" + this.index + ".gif";
            }
        }
    </script>
</body>

</html>